var mongoose = require('mongoose')
var Schema = mongoose.Schema

mongoose.connect('mongodb://localhost:27017/bolg',{useNewUrlParser:true},function(err){
	if(err){
		console.log('数据库连接失败')
	}else{
		console.log('数据库连接成功')
	}
})

var newlists = new Schema({
	id:{
		type:Number,
		required:true,
	},
	title:{
		type:String,
		required:true,
	},
	add_time:{
		type:Date,
		default:Date.now
	},
	zhaiyao:{
		type:String,
		required:false
	},
	click:{
		type:Number,
		required:true,
		default:0
	},
	img_url:{
		String,
		required:false
	}
})
module.exports=mongoose.model('newlist',newlists)